package com.sinothk.gpserver.util;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.sinothk.server.support.entity.PageData;

/**
 * 编写 Liang Y.T.
 * 时间 2021/8/30 12:55
 */
public class PageDataUtil<T> {

    public PageData<T> create(IPage<T> iPage) {
        PageData<T> rspPageData = new PageData<T>();
        rspPageData.setPageNum(iPage.getCurrent());
        rspPageData.setPageSize(iPage.getSize());
        rspPageData.setCurrent(iPage.getCurrent());
        rspPageData.setTotal(iPage.getTotal());
        rspPageData.setData(iPage.getRecords());
        return rspPageData;
    }
}
